# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-httplib2
_pkgname=httplib2
pkgver=0.20.4
pkgrel=0
pkgdesc="Python3 HTTP client library"
url="https://github.com/httplib2/httplib2"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-pytest-cov py3-pytest-timeout py3-cryptography"
source="httplib2-$pkgver.tar.gz::https://github.com/httplib2/httplib2/archive/refs/tags/v$pkgver.tar.gz
	"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-httplib2" # Backwards compatibility
provides="py-httplib2=$pkgver-r$pkgrel" # Backwards compatibility

# secfixes:
#   0.19.0-r0:
#     - CVE-2021-21240

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$PWD/build/lib" python3 -m pytest tests/
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
46396a9bb439e61939e481a2502567a6dc40686471267ea4c357f141ac138193107f90ac465db683e4ab71e5d92249b810657bff0cb74af7a37a9a23c8320741  httplib2-0.20.4.tar.gz
"
